@isTest
private class ProvisioningServiceTest {
    
    public static final string defaultFeed ='https://apps-apis.google.com/a/feeds/myafza.ae/user/2.0'; 

    // test GoogleService here as well...
   public static  testmethod void provServiceTest() { 
        List<Account> accntList = new List<Account>();
        List<Account> updateAccntList = new List<Account>();
    //Account Object Record...
        Account accountObject = new Account();
        accountObject.Name = 'Test Account';
        //accountObject.LicenseNumber__c = serialObject.id;
        accountObject.License_Application_Step__c = 'Record Created';
        accountObject.License_Application_Type__c = 'New License';
        accountObject.Activity__c = 'Trading - One Activity';
        accountObject.License_Issue_Date__c = system.today();
        accountObject.Master_Account_Flag__c = true;
        accountObject.License_Expiry_Date__c = System.Today().addYears(1);
        accntList.add(accountObject);
        
        //Account Object Record...
        Account accountObject2 = new Account();
        accountObject2.Name = 'Test Account';
        accountObject2.License_Application_Step__c = 'Renewal Started';
        //accountObject1.License_Application_Step__c = 'Submitted for Maintenance Department User Approval';
        accountObject2.License_Application_Type__c = 'Renewal';
        accountObject2.Activity__c = 'Trading - One Activity';
        accountObject2.License_Issue_Date__c = system.today();
        accountObject2.License_Expiry_Date__c = System.Today().addYears(1);
        accntList.add(accountObject2);
        
        insert accntList;
        
        
        //For Contact Object Records...
        Contact contactObject1 = new Contact();
        contactObject1.FirstName = 'MyFirstName';
        contactObject1.LastName = 'LastNameManager';
        contactObject1.AccountId = accountObject.id;
        contactObject1.Current_Employer__c =accountObject.id;
        contactObject1.Contact_Type__c = 'Manager';
        contactObject1.MobilePhone = '12345';
        insert contactObject1;
        
        //MY AFZA update record
        accountObject.Authorized_Manager__c = contactObject1.id;
        accountObject.Ready_for_Google_Provisioning__c = true;
        accountObject.MyAFZA_Account_ID__c = '1';       
        accountObject.isRandomPasswordGenerated__c = false;
        accountObject.isGoogleProvisioned__c = false;
        updateAccntList.add(accountObject);
        accountObject2.Authorized_Manager__c = contactObject1.id;
        accountObject2.Ready_for_Google_Provisioning__c = true;
        accountObject2.MyAFZA_Account_ID__c = '2';      
        accountObject2.isRandomPasswordGenerated__c = false;
        accountObject2.isGoogleProvisioned__c = false; 
        updateAccntList.add(accountObject2);           
        
        update updateAccntList;
    

        //make callout   
        
        // Set the mock callout mode
        //GOOGLE SERVICE        
        GoogleService gService = new GoogleService('provisions');
        
        
        
        //PROVIOSINING             
        ProvisioningService service = new ProvisioningService();
        //service.useClientLogin('geo@myafza.ae', 'CCPa$$w0rd');  
       
        /*
        ProvisioningService.sendMailAlert('test',updateAccntList[0].Name);
        String response =  ProvisioningService.postServiceRequest(updateAccntList); 
        
        service.insertEntryXML('ts');    
        */
        ProvisioningService.sendMailAlert(300, 'test',updateAccntList[0].Name);
        String response =  ProvisioningService.postServiceRequest(updateAccntList[0].id, contactObject1.FirstName, contactObject1.LastName, contactObject1.MobilePhone); 
        
        service.insertEntryXML('ts');    
               
        //Assert some values that can be asserted
         //system.assertEquals('End', response);
         
                
        
        
   }
}